import 'package:flutter/material.dart';

class DataScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return DefaultTabController(
      length: 3,
      child: Scaffold(
        appBar: AppBar(
          title: Text('数据'),
          actions: <Widget>[
            FlatButton(
              child: Text('查看概览'), 
              color: Color.fromRGBO(46, 137, 250, 1),
              textColor: Colors.white,
              onPressed: () {
                print('查看概览');
              },
            )
          ],
          bottom: TabBar(
            // 标签指示器的宽度
            indicatorSize: TabBarIndicatorSize.label,
            // 标签指示器的颜色
            indicatorColor: Colors.white,
            // 标签指示器的高度
            indicatorWeight: 2,
            tabs: <Widget>[
              Tab(text: '客流统计',),
              Tab(text: '顾客分析',),
              Tab(text: '热点分析',),
            ],
          ),
        ),
        body: TabBarView(
          children: <Widget>[
            Center(child: Text('顾客分析')),
            Center(child: Text('顾客分析')),
            Center(child: Text('热点分析')),
          ],
        ),
      ),
    );
  }
}
